package chapter67;

import java.util.Scanner;

/*
 * 根据给的不同水果榨不同的汁
 */
public class TestZhaZhi {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		ZhaZhiJi machine1 = new ZhaZhiJi();
		// 是否继续的标志，true代表继续false代表不继续
		boolean flag = false;
		do {
			System.out.print("请给水果：");
			String fruit = input.next();
			System.out.print("你要多少杯？");
			int num = input.nextInt();
			String zhi = machine1.ZhaZhi(num, fruit);
			System.out.println(zhi);
			System.out.print("是否继续？(y/n)");
			String shuru = input.next();
			if (shuru.equals("y")) {
				flag = true;
			} else {
				flag = false;
			}
		} while (flag);
		System.out.println("程序结束");
	}

}
